package com.web;

import java.util.Scanner;

/* 请在下面的【】处补充代码
 */
//测试类
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double n = scanner.nextDouble();
        for (int i = 0; i < n; i++) {
            double t1 = scanner.nextDouble();
            double t2 = scanner.nextDouble();
            double t3 = scanner.nextDouble();
            if (t1 <= 0 || t2 <= 0 || t3 <= 0) {
                System.out.println("0.00 0.00 0.00 0.00");
            } else {
                Cubic cubic = new Cubic(t1, t2, t3);
                Pyramid pyramid = new Pyramid(t1, t2, t3);
                System.out.println(cubic.area() + " " + cubic.V() + " " + pyramid.area() + " ");
            }
        }
    }

}

abstract class Rect {
    public double l;
    public double h;
    public double z;

    public Rect(double l, double h, double z) {
        this.l = l;
        this.h = h;
        this.z = z;
    }

    public double length() {
        return (l + h) * 2;
    }

    public double area() {
        return (l * h);
    }

    ;
}

class Cubic extends Rect {

    public Cubic(double l, double h, double z) {
        super(l, h, z);
    }

    @Override
    public double area() {
        return (l * h + z * h + l * z) * 2;
    }

    public double V() {
        return (l * h * z);
    }

}

class Pyramid extends Rect {


    public Pyramid(double l, double h, double z) {
        super(l, h, z);
    }

    @Override
    public double area() {
        double s1 = Math.sqrt((l / 2) * (l / 2) + z * z);
        double s2 = Math.sqrt((h / 2) * (h / 2) + z * z);
        return s1 * h + s2 * l + l * h;
    }

    public double V() {
        return (1 / 3) * (h * l) * z;
    }
}
